3.162 \(\int \csc ^2(e+f x) (a+b \sin (e+f x))^2 \, dx\)

Optimal. Leaf size=34 \[ -\frac{a^2 \cot (e+f x)}{f}-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}+b^2 x \]

[Out]

b^2*x - (2*a*b*ArcTanh[Cos[e + f*x]])/f - (a^2*Cot[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0655697, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {2789, 3770, 3012, 8} \[ -\frac{a^2 \cot (e+f x)}{f}-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}+b^2 x \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Sin[e + f*x])^2,x]

[Out]

b^2*x - (2*a*b*ArcTanh[Cos[e + f*x]])/f - (a^2*Cot[e + f*x])/f

Rule 2789

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[(2*c*d)/b
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \csc ^2(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc (e+f x) \, dx+\int \csc ^2(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a^2 \cot (e+f x)}{f}+b^2 \int 1 \, dx\\ &=b^2 x-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a^2 \cot (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 0.220298, size = 76, normalized size = 2.24 \[ \frac{a^2 \tan \left (\frac{1}{2} (e+f x)\right )+a^2 \left (-\cot \left (\frac{1}{2} (e+f x)\right )\right )+2 b \left (2 a \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-2 a \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )+b e+b f x\right )}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Sin[e + f*x])^2,x]

[Out]

(-(a^2*Cot[(e + f*x)/2]) + 2*b*(b*e + b*f*x - 2*a*Log[Cos[(e + f*x)/2]] + 2*a*Log[Sin[(e + f*x)/2]]) + a^2*Tan
[(e + f*x)/2])/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.042, size = 52, normalized size = 1.5 \begin{align*}{b}^{2}x-{\frac{{a}^{2}\cot \left ( fx+e \right ) }{f}}+2\,{\frac{ab\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}e}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*sin(f*x+e))^2,x)

[Out]

b^2*x-a^2*cot(f*x+e)/f+2/f*a*b*ln(csc(f*x+e)-cot(f*x+e))+1/f*b^2*e

________________________________________________________________________________________

Maxima [A]  time = 1.65617, size = 70, normalized size = 2.06 \begin{align*} \frac{{\left (f x + e\right )} b^{2} - a b{\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac{a^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

((f*x + e)*b^2 - a*b*(log(cos(f*x + e) + 1) - log(cos(f*x + e) - 1)) - a^2/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [B]  time = 1.99554, size = 209, normalized size = 6.15 \begin{align*} \frac{b^{2} f x \sin \left (f x + e\right ) - a b \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) + a b \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) - a^{2} \cos \left (f x + e\right )}{f \sin \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

(b^2*f*x*sin(f*x + e) - a*b*log(1/2*cos(f*x + e) + 1/2)*sin(f*x + e) + a*b*log(-1/2*cos(f*x + e) + 1/2)*sin(f*
x + e) - a^2*cos(f*x + e))/(f*sin(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (e + f x \right )}\right )^{2} \csc ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*sin(f*x+e))**2,x)

[Out]

Integral((a + b*sin(e + f*x))**2*csc(e + f*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.75793, size = 107, normalized size = 3.15 \begin{align*} \frac{2 \,{\left (f x + e\right )} b^{2} + 4 \, a b \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) \right |}\right ) + a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - \frac{4 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a^{2}}{\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e))^2,x, algorithm="giac")

[Out]

1/2*(2*(f*x + e)*b^2 + 4*a*b*log(abs(tan(1/2*f*x + 1/2*e))) + a^2*tan(1/2*f*x + 1/2*e) - (4*a*b*tan(1/2*f*x +
1/2*e) + a^2)/tan(1/2*f*x + 1/2*e))/f